<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
    <h4 class="modal-title" id="myModalLabel">弹出框</h4>
</div>
<form class="form-horizontal J_ajaxForm" role="form" method="get" action="../server/ajaxReturn.json" data-validate="validate">
    <div class="modal-body">
        <div class="form-group">
            <label class="col-sm-3 control-label">新闻标题</label>
            <div class="col-sm-9">
                <input type="text" class="form-control" placeholder="新闻标题" name="title">
                <!--<p class="help-block">必填</p>-->
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">新闻分类</label>
            <div class="col-sm-9">
                <select class="form-control" name="category">
                    <option value="0">请选择</option>
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">作者</label>
            <div class="col-sm-9">
                <input type="text" class="form-control" placeholder="作者" name="author">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">是否审核通过</label>
            <div class="col-sm-9">
                <div class="radio">
                    <label>
                        <input type="radio" name="audit" value="1" checked>通过
                    </label>
                </div>
                <div class="radio">
                    <label>
                        <input type="radio" name="audit" value="2">未通过
                    </label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-3 col-sm-9">
                <div class="checkbox">
                    <label>
                        <input type="checkbox" name="remember" value="1">记住我
                    </label>
                </div>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
        <button type="button" class="btn btn-primary J_ajaxSubmitBtn">提交</button>
    </div>
</form>

<script>
    function validate($from) {
        var title = $from.find('input[name="title"]');
        if ($.trim(title.val()) == '') {
            return '新闻标题不能为空';
        }

        return true;
    }
</script>